/* omvclilib.h
 * OMV client C API library functions and tokens.
 * Copyright (c) 2004 Ladybridge Systems, All Rights Reserved
 */

/* Function definitions */

#ifdef __BORLANDC__
   /* Borland C compiler for Windows users */
   #define DLLEntry __declspec(dllimport)
#endif

#ifdef _MSC_VER
   /* Microsoft C compiler for Windows users */
   #define DLLEntry __declspec(dllimport)

   #define OMVCall _QMCall
   #define OMVChange _QMChange
   #define OMVClearSelect _QMClearSelect
   #define OMVClose _QMClose
   #define OMVConnect _QMConnect
   #define OMVConnected _QMConnected
   #define OMVConnectLocal _QMConnectLocal
   #define OMVDisconnect _QMDisconnect
   #define OMVDisconnectAll _QMDisconnectAll
   #define OMVDcount _QMDcount
   #define OMVDel _QMDel
   #define OMVDelete _QMDelete
   #define OMVDeleteu _QMDeleteu
   #define OMVEndCommand _QMEndCommand
   #define OMVError _QMError
   #define OMVExecute _QMExecute
   #define OMVExtract _QMExtract
   #define OMVField _QMField
   #define OMVFree _QMFree
   #define OMVGetSession _QMGetSession
   #define OMVIns _QMIns
   #define OMVLocate _QMLocate
   #define OMVMarkMapping _QMMarkMapping
   #define OMVMatch _QMMatch
   #define OMVMatchfield _QMMatchfield
   #define OMVOpen _QMOpen
   #define OMVRead _QMRead
   #define OMVReadl _QMReadl
   #define OMVReadList _QMReadList
   #define OMVReadNext _QMReadNext
   #define OMVReadu _QMReadu
   #define OMVRelease _QMRelease
   #define OMVReplace _QMReplace
   #define OMVRespond _QMRespond
   #define OMVSelect _QMSelect
   #define OMVSelectIndex _QMSelectIndex
   #define OMVSelectLeft _QMSelectLeft
   #define OMVSelectRight _QMSelectRight
   #define OMVSetLeft _QMSetLeft
   #define OMVSetRight _QMSetRight
   #define OMVSetSession _QMSetSession
   #define OMVStatus _QMStatus
   #define OMVWrite _QMWrite
   #define OMVWriteu _QMWriteu
#endif

#ifndef DLLEntry
   /* Other platforms */
   #define DLLEntry
#endif

DLLEntry void OMVCall(char * subrname, short int argc, ...);
DLLEntry char * OMVChange(char * src, char * old_string, char * new_string, int occurrences, int start);
DLLEntry void OMVClearSelect(int listno);
DLLEntry void OMVClose(int fno);
DLLEntry int OMVConnect(char * host, int port, char * username, char * password, char * account);
DLLEntry int OMVConnected(void);
DLLEntry int OMVConnectLocal(char * account);
DLLEntry int OMVDcount(char * src, char * delim_str);
DLLEntry char * OMVDel(char * src, int fno, int vno, int svno);
DLLEntry void OMVDelete(int fno, char * id);
DLLEntry void OMVDeleteu(int fno, char * id);
DLLEntry void OMVDisconnect(void);
DLLEntry void OMVDisconnectAll(void);
DLLEntry void OMVEndCommand(void);
DLLEntry char * OMVError(void);
DLLEntry char * OMVExecute(char * cmnd, int * err);
DLLEntry char * OMVExtract(char * src, int fno, int vno, int svno);
DLLEntry char * OMVField(char * src, char * delim, int first, int occurrences);
DLLEntry void OMVFree(void * p);
DLLEntry int OMVGetSession(void);
DLLEntry char * OMVIns(char * src, int fno, int vno, int svno, char * new_string);
DLLEntry int OMVLocate(char * item, char * src, int fno, int vno, int svno, int * pos, char * order);
DLLEntry void OMVMarkMapping(int fno, int state);
DLLEntry int OMVMatch(char * str, char * pattern);
DLLEntry char * OMVMatchfield(char * str, char * pattern, int component);
DLLEntry int OMVOpen(char * filename);
DLLEntry char * OMVRead(int fno, char * id, int * err);
DLLEntry char * OMVReadl(int fno, char * id, int wait, int * err);
DLLEntry char * OMVReadList(int listno);
DLLEntry char * OMVReadNext(short int listno);
DLLEntry char * OMVReadu(int fno, char * id, int wait, int * err);
DLLEntry void OMVRelease(int fno, char * id);
DLLEntry char * OMVReplace(char * src, int fno, int vno, int svno, char * new_string);
DLLEntry char * OMVRespond(char * response, int * err);
DLLEntry void OMVSelect(int fno, int listno);
DLLEntry void OMVSelectIndex(int fno, char * indexname, char * indexvalue, int listno);
DLLEntry char * OMVSelectLeft(int fno, char * indexname, int listno);
DLLEntry char * OMVSelectRight(int fno, char * indexname, int listno);
DLLEntry void OMVSetLeft(int fno, char * indexname);
DLLEntry void OMVSetRight(int fno, char * indexname);
DLLEntry int OMVSetSession(int session);
DLLEntry int OMVStatus(void);
DLLEntry void OMVWrite(int fno, char * id, char * data);
DLLEntry void OMVWriteu(int fno, char * id, char * data);


/* Server error status values */

#define SV_OK             0    /* Action successful                       */
#define SV_ON_ERROR       1    /* Action took ON ERROR clause             */
#define SV_ELSE           2    /* Action took ELSE clause                 */
#define SV_ERROR          3    /* Action failed. Error text available     */
#define SV_LOCKED         4    /* Action took LOCKED clause               */
#define SV_PROMPT         5    /* Server requesting input                 */

/* END-CODE */
